class Solution {
public:
    int lengthOfLIS(vector<int>& nums) {
        int  n = nums.size();
        if (n == 0) return 0;
        int dp[10000] = { 0 };
        dp[0] = 1;
        int res = 1;
        for (int i = 0; i < n; i++)
        {
            dp[i] = 1;
            for (int j = 0; j < i; j++)
            {
                if (nums[i] > nums[j])
                    dp[i] = max(dp[i], dp[j] + 1);
            }
            res = max(dp[i], res);
        }
        return res;


    }
};